﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PostAddressEdit.aspx.cs" Inherits="CNVP.JShop.Web.Admin.PostAddressEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
            <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="IE=7" http-equiv="X-UA-Compatible" />
    <link href="CSS/Edit.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery.js" type="text/javascript"></script>
    <script src="../Scripts/Common.js" type="text/javascript"></script>
    <script type="text/javascript">
        //选择省份时引发的动作
        function ProvinceChange() {
            var ddlProvince = document.getElementById("<%=ddlProvince.ClientID %>");
            var selectCity = document.getElementById("selectCity");
            selectCity.innerHTML = GetAjaxResponse("CommonWindows/AjaxCity.aspx?Type=ProvinceID&Code=" + ddlProvince.value);
            if(<%=id %> > 0)
            {
                if(ddlProvince.value==<%=Province %>)
                {
                    var ListCity = document.getElementById("ListCity");
                    ListCity.value=<%=City %>;
                }
            }
            CityChange();
            
        }
        //选择市时引发的动作
        function CityChange() {
            var ListCity = document.getElementById("ListCity");
            var selectArea = document.getElementById("selectArea");
            selectArea.innerHTML = GetAjaxResponse("CommonWindows/AjaxCity.aspx?Type=CityID&Code=" + ListCity.value);
            if(<%=id %> > 0)
            {
                if(ListCity.value==<%=City %>)
                {
                    var ListArea = document.getElementById("ListArea");
                    ListArea.value=<%=Area %>;
                }
            }
        }
        $(function(){
            $("#btSaveAddress").click(function(){
                var $txtPostTitle=$("#txtPostTitle");
                if($txtPostTitle.val()=="")
                {
                    alert("请输入发货点名称！");
                    $txtPostTitle.focus();
                    return false;
                }
                var $ddlProvince=$("#ddlProvince");
                if($ddlProvince.val()=="")
                {
                    alert("请输入省区！");
                    $ddlProvince.focus();
                    return false;
                }
                var $ListCity=$("#ListCity");
                if($ListCity.val()=="")
                {
                    alert("请输入市区！");
                    $ListCity.focus();
                    return false;
                }
                var $ListArea=$("#ListArea");
                if($ListArea.val()=="")
                {
                    alert("请输入地区！");
                    $ListArea.focus();
                    return false;
                }
                var $txtText=$("#txtText");
                if($txtText.length >2000)
                {
                    alert("备注太长，请输入小于2000字！");
                    $txtText.focus();
                    return false;
                }
                return true;
            });
        })
    </script>
</head>
<body onload="ProvinceChange()">
    <form id="form1" runat="server">
        <div class="Content">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="cell">
            <tr>
                <td class="cell_group">
                    <img src="Images/ListIconTitle.jpg" alt="" />&nbsp;您的位置：<a href="PostAddressList.aspx">发货信息管理</a><asp:Label ID="lbTitle" runat="server"></asp:Label>
                </td>
            </tr>
            </table>
            <table border="0" cellpadding="0" cellspacing="0" width="100%" class="division">
                <tr>
                    <th>
                        发货点名称：</th>
                    <td colspan="3">
                        <asp:TextBox ID="txtPostTitle" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</th>
                    <td >
                        <asp:TextBox ID="txtPostTrueName" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                    <th>
                        性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</th>
                    <td >
                        <asp:RadioButtonList ID="rblSex" runat="server" 
                            RepeatDirection="Horizontal" Width="100px" CssClass="RadioButtonListTable" 
                            CellPadding="0" CellSpacing="0">
                            <asp:ListItem Value="0" Selected="True">男</asp:ListItem>
                            <asp:ListItem Value="1">女</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <th>
                        省&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区：</th>
                    <td colspan="3">
                        <asp:DropDownList ID="ddlProvince" runat="server" Width="160px">
                        <asp:ListItem Value="0">--请选择--</asp:ListItem>
                        </asp:DropDownList>
                        <span id="selectCity"></span>
                        <span id="selectArea"></span>
                         
                        </td>
                </tr>
                <tr>
                    <th>
                        地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：</th>
                    <td colspan="3">
                        <asp:TextBox ID="txtPostAddress" runat="server" Width="400px" MaxLength="100"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编：</th>
                    <td colspan="3">
                        <asp:TextBox ID="txtZipCode" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机：</th>
                    <td>
                        <asp:TextBox ID="txtMobilePhone" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                    <th>
                        电&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;话：</th>
                    <td>
                        <asp:TextBox ID="txtPhone" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                </tr>
                 <tr>
                    <th>
                        设置默认地址：</th>
                    <td colspan="3">
                       
                        <asp:CheckBox ID="cbIsTolerant" runat="server" />
                       
                    </td>
                </tr>
                <tr>
                    <th>
                        备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
                    <td colspan="3">
                        <asp:TextBox ID="txtText" runat="server" Rows="5" TextMode="MultiLine" 
                            Width="400px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        <div class="EditBtn">  
                    <asp:Button ID="btSaveAddress" runat="server" onclick="btSaveAddress_Click" Text="保存订单地址" />
                    <input type="button" value="取消" onclick="javascript:history.go(-1)" />
        </div>
    </div>
    </form>
</body>
</html>